# coding=utf-8
# 代码文件：chapter1/ch1.13.2.py

f_name = 'data/test1.txt'

with open(f_name, 'r', encoding='utf-8') as f:
    lines = f.readlines()                 # 读从文件中读取数据到一个列表中
    print(lines)
    copy_f_name = 'data/copy.txt'
    with open(copy_f_name, 'w', encoding='utf-8') as copy_f:
        copy_f.writelines(lines)          # 将列表数据写入到文件中
        print('文件复制成功')
